import junit.framework.TestCase;
import org.junit.Test;


public class StringBufferDemoTest extends TestCase {
    @Test
    public void testMain() throws Exception {
        StringBuffer buffer = new StringBuffer();
        buffer.append("java");
        System.out.println(buffer.charAt(2));
        buffer.append("tringBuffer1234567asdfghjklqwertyu");
        System.out.println(buffer.capacity());
        System.out.println("buffer = " + buffer.toString());
        System.out.println(buffer.length());
        StringBuffer buffer2 = new StringBuffer(40);
        buffer2.append("tringBuffer1234567asdfghjklqwertyu");
        System.out.println(buffer2.capacity());
        System.out.println("buffer2 = " + buffer.toString());
        System.out.println(buffer2.length());
    }

}

